package com.gm.wholesale.constant;

public enum PayMethod {
    //支付方式， 1-现金，2-微信，3-支付宝
    WX(2, "微信"),
    ZFB(3, "支付宝"),
    XJ(1, "现金");
    private String message;
    private int type;
    PayMethod(int type, String desc) {
        this.type = type;
        this.message = desc;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public static PayMethod getByCode(int code) {
        for (PayMethod data : values()) {
            if (data.getType()==code) {
                return data;
            }
        }
        return PayMethod.WX;
    }
}
